import { Http } from "../utils/http";

class Message extends Http {
  constructor(props) {
    super(props);
  }

  //获取系统消息

  getSystemMsg(pageNo = 1, pageSize = 10) {
    return this.request({
      url: "/mini/miniMessage/sysAppList",
      method: "get",
      data: {
        pageNo,
        pageSize,
      },
    });
  }

  //更改消息状态
  changeMsgStatus(id) {
    return this.request({
      url: "/mini/miniMessage/updateDelFlag",
      method: "post",
      data: {
        id,
      },
    });
  }

  //获取单条消息
  getById(id) {
    return this.request({
      url: "/mini/miniMessage/getById",
      data: {
        id,
      },
    });
  }

  getRed() {
    return this.request({
      url: "/mini/miniMessage/getRed",
    });
  }
  getCommunityMsg(pageNo = 1, pageSize = 10) {
    return this.request({
      url: "/mini/miniMessage/commAppList",
      method: "get",
      data: {
        pageNo,
        pageSize,
      },
    });
  }
}

export { Message };
